// fn1();
function fn1(){
    const xhr = new XMLHttpRequest();
    xhr.open('POST', '/api/cart/add', true);
    xhr.onload = function(){
        const res = JSON.parse(xhr.responseText);
        console.log(res);
    }
    // xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    xhr.setRequestHeader('Content-Type','application/json');
    xhr.send('{"id":"123","goodsId":18}');
}
fn2();
function fn2(){
    const xhr = new XMLHttpRequest();
    xhr.open('POST', '/users/login', true);
    xhr.onload = function(){
        const res = JSON.parse(xhr.responseText);
        console.log(res);
    }
    xhr.setRequestHeader('Content-Type','application/json');
    xhr.send('{"id":"123","goodsId":18}');
}